//
//  MainViewViewController.m
//  E-learning
//
//  Created by MinwenYi on 14-7-1.
//  Copyright (c) 2014年 Yang. All rights reserved.
//

#import "MainViewViewController.h"

@interface MainViewViewController ()

@property(nonatomic,strong) UIButton *openBtn;
@end

@implementation MainViewViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.openBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.openBtn.frame = CGRectMake(10, 30, 60, 30);
    self.openBtn.backgroundColor = [UIColor yellowColor];
    [self.openBtn addTarget:self action:@selector(openDrawer:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_openBtn];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - config the view layout

- (BOOL)prefersStatusBarHidden
{
    return NO;
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
	return UIStatusBarStyleLightContent;
}

#pragma mark - openBtn Action

- (void)openDrawer:(id)sender
{

    [self.drawer open];
}

#pragma mark - ICSDrawerController

- (void)drawerControllerWillOpen:(ICSDrawerController *)drawerController
{
    self.view.userInteractionEnabled = NO;
}

- (void)drawerControllerWillClose:(ICSDrawerController *)drawerController
{
    self.view.userInteractionEnabled = YES;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
